{layout name="layout" /}
<form id="form" action="{:url('fastshop/item/add')}">
    <input type="hidden" id="category_id" name="category_id" />
    <input type="hidden" id="category_path_id" name="category_path_id" />
    <table class="formtable">
        <tr>
            <th>商品属性:</th>
            <td>
                <select datatype="*" class="select" name="types">
                    <option value="0">默认属性</option>
                    <option value="1">首页推荐</option>
                    <option value="2">搜索页推荐</option>
                    <option value="3">购物车推荐</option>
                </select>
            </td>
        </tr>
        <tr><th><span class="red">*</span> 商品分类:</th><td><div class="ext-select w400" id="category_path_name" data="category">请选择商品分类</div></td></tr>
        <tr><th><span class="red">*</span> 商品名称:</th><td><input class="input w500" datatype="*" type="text" name="name" /></td></tr>  
        <tr><th>* 商品价格(￥):</th><td>
                <label>成本(￥)：</label><input placeholder="成本价：(￥)" class="input w100" datatype="npot" type="text" name="price" /> 
                <label>销售(￥)：</label> <input placeholder="销售价(￥)" class="input w100" datatype="npot" type="text" name="sell_price"/>
                <label>市场(￥)：</label><input placeholder="市场价(￥)" class="input w100" datatype="npot" type="text" name="market_price" />   
        </td></tr>
        <tr><th>* 商品属性:</th><td>
            <label>重量(g)：</label><input class="input w100" datatype="n" type="text" name="weight"  value="0" />
            <label>积分购物：</label><input class="input w100" datatype="n" type="text" name="points" value="0" />
            <label>赠送积分：</label><input class="input w100" datatype="n" type="text" name="repoints"  value="0"/>
        </td></tr>
        <tr class="imgs">
            <th><input type="hidden" name="img" id="img_index" />产品预览图</th>
            <td id="imgbox"><div id="img-win" data="img" class="img-review fn-left fn-cp"></div></td>
        </tr>
        <tr><th>商品详情</th><td><textarea class="textarea ui-editor" id="content" name="content"></textarea></td></tr>
        <tr><th></th><td><input type="submit" value="确定" class="button button-blue submit" /> <input type="reset" value="重置" class="button button-blank" /></td></tr>
    </table>
</form>
<script type="text/javascript">
Do.add('common',{path:'__STATIC__/fastshop/common.js'});
Do('base','layer','form','editor','common',function () {
    $('#form').isForm({'upload':'{:url("system/passport.common/upload")}'});
    $("#img-win").click(function(){openwin('{:url("system/passport.common/upload")}')}); //添加图片库 
    $("#category_path_name").click(function(){$(this).popup('{:url("fastshop/item/category")}') });  //选择栏目
})
</script>